#include "VoicePlayer.h"

#ifdef _WIN32
#include "VoicePlayerWinImp.h"
#elif _LINUX
#include "VoicePlayerLinuxImp.h"
#endif

VoicePlayer* VoicePlayer::m_pInstance = NULL;

VoicePlayer::VoicePlayer()
	: m_pImp(NULL)
{
	m_pImp = new VoicePlayerImp;
}


VoicePlayer::~VoicePlayer()
{
	if (m_pImp != NULL) {
		delete m_pImp;
		m_pImp = NULL;
	}
}

VoicePlayer* VoicePlayer::GetInstance()
{
	if (m_pInstance == NULL) {
		m_pInstance = new VoicePlayer;
	}
	return m_pInstance;
}

void VoicePlayer::Destroy()
{
	if (m_pInstance == NULL) {
		return;
	}
	delete m_pInstance;
	m_pInstance = NULL;
}

void VoicePlayer::Play(BDString path)
{
	m_pImp->Play(path);
}

